#
# @lc app=leetcode.cn id=55 lang=python
#
# [55] 跳跃游戏
#

# @lc code=start
class Solution(object):
    def canJump(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        max_cover = 0
        if len(nums) == 1:
            return True
        for i in range(len(nums)-1):
            if i <= max_cover:
                max_cover = max(nums[i]+i, max_cover)
            
            if max_cover >= len(nums)-1:
                return True
        return False
        
# @lc code=end

